package org.cshoo.sys.business
{
	import hessian.client.HessianService;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	
	import org.cshoo.common.business.ServiceLocator;
	import org.cshoo.sys.model.vo.Parameter;
	
	public class ParameterDelegate
	{
		public var serviceLocator:ServiceLocator = ServiceLocator.getInstance();
		
		public var _service:HessianService;
		
		private var _responder:IResponder;
		
		public function ParameterDelegate(responder:IResponder)
		{
			_service = serviceLocator.parameterService;
			this._responder = responder;
		}
		
		public function findParameterList(parameterExample:Parameter):void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("findParameterList").send(parameterExample);
			asyncToken.addResponder(_responder);
		}
		
		public function addParameter(parameter:Parameter):void
		{
			var asyncToken:AsyncToken = _service.getOperation("addParameter").send(parameter);
			asyncToken.addResponder(_responder);	
		}
		
		public function deleteParameter(parameter:Parameter):void
		{
			var asyncToken:AsyncToken = _service.getOperation("deleteParameter").send(parameter);
			asyncToken.addResponder(_responder);
		}
		
		public function updateParameter(parameter:Parameter):void
		{
			var asyncToken:AsyncToken = _service.getOperation("updateParameter").send(parameter);
			asyncToken.addResponder(_responder);
		}
	}
}